import {
	mapGetters
} from "vuex"

export default {
	computed: {
		...mapGetters('m_cart', ['total'])
	},
	onShow() {
		this.setBadge()
	},

	data() {
		return {

		};
	},
	methods: {
		//动态为tabbar页面设置角标,封装起来以便每一个页面调用更加方便
		setBadge() {
			uni.setTabBarBadge({
				//设置tabbar页面数组的索引
				index: 1,
				//把this.total转化为字符串输出
				text: this.total + ''
			})
		}
	}
}
